{% extends '::admin.html.twig' %} 
{% block title %}
    Администраторская часть
{% endblock %}
{% block body %}
<h1>User edit</h1>

<form action="{{ path('admin_user_update', { 'id': entity.id }) }}" method="post" {{ form_enctype(edit_form) }}>
    {{ form_errors(edit_form) }}
    <div>
      {{ form_label(edit_form.username) }}
      {{ form_errors(edit_form.username) }}
      {{ form_widget(edit_form.username, { 'attr': {'class': 'text ui-widget-content ui-corner-all'}} ) }}
    </div>
    <div>
      {{ form_label(edit_form.email) }}
      {{ form_errors(edit_form.email) }}
      {{ form_widget(edit_form.email, { 'attr': {'class': 'text ui-widget-content ui-corner-all'}}) }}
    </div>
    <div class="ym-fbox-text">
      {{ form_label(edit_form.old_password) }}
      {{ form_errors(edit_form.old_password) }}
      {{ form_widget(edit_form.old_password) }}
    </div>
    <div class="ym-fbox-text">
      {{ form_label(edit_form.new_password) }}
      {{ form_errors(edit_form.new_password) }}
      {{ form_widget(edit_form.new_password) }}
    </div>
    <div class="ym-fbox-check">
      {{ form_label(edit_form.userRoles) }}
      {{ form_errors(edit_form.userRoles) }}
      {{ form_widget(edit_form.userRoles) }}
    </div>
    {{ form_rest(edit_form) }}
    <p>
        <button type="submit">Edit</button>
    </p>
</form>

<ul class="record_actions">
    <li>
        <a href="{{ path('admin_user') }}">
            Back to the list
        </a>
    </li>
    <li>
        <form action="{{ path('admin_user_delete', { 'id': entity.id }) }}" method="post">
            {{ form_widget(delete_form) }}
            <button type="submit">Delete</button>
        </form>
    </li>
</ul>
{% endblock %}
{% block post_javascripts %}
  {{ parent() }}
  <script type="text/javascript">
  $(document).ready(function(){
    $('button').button();
  });
  </script>
{% endblock %}